#!/usr/bin/python

class node:
	def __init__(self, a, b):
		self.a = a
		self.b = b
	def print_node(self):
		print self.a, self.b

def remove_node(list):
	i = 1
	while i < len(list):
		if list[i].a %2 == 0:
			list.remove(list[i])
		else:
			i = i + 1

list = []
for i in range(0, 5):
	list.append(node(5 - i, i))
for node in list:
	node.print_node()

print

list.sort(lambda x, y:cmp(x.a, y.a))
for node in list:
	node.print_node()

print
remove_node(list)
for node in list:
	node.print_node()
